//
// Created by 李传智 on 2018/4/15.
//

#include "FFPlayerBuilder.h"
#include "FFResample.h"
#include "GLVideoView.h"
#include "FFDemux.h"
#include "SLAudioPlay.h"
#include "IPlayer.h"
#include "FFDecode.h"
#include "FFRecorder.h"

FFPlayerBuilder *FFPlayerBuilder::get() {
    static FFPlayerBuilder builder;
    return &builder;
}

IResample *FFPlayerBuilder::createResample() {
    return new FFResample();
}

IVideoView *FFPlayerBuilder::createVideoView() {
    return new GLVideoView();
}

IDecode *FFPlayerBuilder::createDecode() {
    return new FFDecode();
}

IDemux *FFPlayerBuilder::createDemux() {
    return new FFDemux();
}

IPlayer *FFPlayerBuilder::createPlayer(unsigned char index) {
    return IPlayer::get(index);
}

IAudioPlay *FFPlayerBuilder::createAudioPlay() {
    return new SLAudioPlay();
}

void FFPlayerBuilder::initHard(void *vm) {
    FFDecode::initHard(vm);
}

IRecorder* FFPlayerBuilder::createRecorder() {
    return new FFRecorder();
}